package com.liweiwei.role.controller;

import com.alibaba.fastjson.JSONObject;
import com.liweiwei.role.base.BaseController;
import com.liweiwei.role.service.RoleService;
import com.liweiwei.role.service.serviceImpl.RoleServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebServlet;
import java.io.BufferedReader;
import java.io.IOException;

@WebServlet(name="LiWeiWeiRoleGetController",urlPatterns="/LWW/post.do")
public class RolePostController extends BaseController {

    private RoleService roleService=new RoleServiceImpl();

    @Override
    public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("UTF-8");
        BufferedReader reader = request.getReader();
        String rr = reader.readLine();
        JSONObject jsonObject = JSONObject.parseObject(rr);
        // 用json封装Method RoleId  RoleName
        String method = jsonObject.getString("method");
        String name = jsonObject.getString("name");
        String id = jsonObject.getString("id");

    }
}
